# -*- coding: utf-8 -*-
"""
@ auth : carl_DJ
@ time : 2020-9-30
"""

from geventhttpclient import HTTPClient
from geventhttpclient.url import URL

url = URL('http://baidu.com')

http = HTTPClient(url.host)

# 获取一个请求
response = http.get(url.request_uri)

# 读取状态码
code=response.status_code
print(code)

# 读取返回内容
# body = response.read()


# 关闭链接
http.close()
